package com.zy.dp.observer.example5;

public class Client
{
	public static void main(String[] args)
	{

		WaterQuality subject = new WaterQuality();

		WatcherObserver watcher1 = new Watcher();
		watcher1.setJob("监测人员");

		WatcherObserver watcher2 = new Watcher();
		watcher2.setJob("预警人员");
		WatcherObserver watcher3 = new Watcher();
		watcher3.setJob("监测部门领导");

		subject.attach(watcher1);
		subject.attach(watcher2);
		subject.attach(watcher3);

		System.out.println("当水质为正常的时候-------");

		subject.setPolluteLevel(0);
		System.out.println("当水质轻度污染的时候----");

		subject.setPolluteLevel(1);

		System.out.println("但水质重度污染的时候------");

		subject.setPolluteLevel(2);

	}
}